package com.tool

import android.content.Context
import android.content.pm.PackageInfo

/**
 * Created by mac on 2017/8/4.
 */
class SystemTool {

    companion object {
        fun screenWidth(context: Context?): Int  {
            return context?.resources?.displayMetrics?.widthPixels!!
        }

        fun screenHeight(context: Context?): Int {
            return context?.resources?.displayMetrics?.heightPixels!!
        }

        fun getAppinfo(context: Context?): PackageInfo? {
            return context?.packageManager?.getPackageInfo(context?.packageName, 0)
        }
    }

}